<!DOCTYPE html>
<html>
<head>
	{include file="common_header" /}
	{include file="common_top" /}
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-body">
		  <div class="layui-box">
			<a class="layui-btn layuiadmin-btn-useradmin" onClick="callurl('{:url('order/export')}')" data-type="add" target="_blank">导出未发货订单</a>
			<a class="layui-btn layuiadmin-btn-useradmin" href="{:url('order/import')}" data-type="add" >导入发货订单</a>
	      </div>
		  
			<div class="layui-box layui-laypage layui-laypage-molv">{$page}</div>
            <table class="layui-table" lay-even="" lay-skin="nob">
            <thead>
              <tr>
                
				<th>订单号</th>
                <th>外部单号</th>
				<th>下单时间</th>
                <th>用户</th>
				<th>总价</th>
				<th>礼物</th>
				<th>单价</th>
				<th>仓库</th>
				<th>平台</th>
                <th>发货人</th>
				<th>发货电话</th>
				<th>收货人</th>
				<th>收货电话</th>
				<th>快递费</th>
				<th>快递单号</th>
                <th>状态</th>
				<th>说明</th>
				<th>管理</th>
              </tr> 
            </thead>
            <tbody>
             {volist name="order" id="vo"}
				<tr id="tr_{$vo.o_id}">
					
					<td>{$vo.o_sncode}</td>
                    <td>{$vo.o_out_sncode}</td>
					<td>{$vo.o_addtime}</td>
					<td>{$vo.u_phone}</td>
					<td>{$vo.o_zmoney}元</td>
					<td>{$vo.gift_title}</td>
					<td>{$vo.o_gift_money}元</td>
					<td>{$vo.w_title}</td>
					<td>{$vo.pf_title}</td>
					<td>{$vo.o_fa_name}</td>
					<td>{$vo.o_fa_phone}</td>
					<td>{$vo.o_sho_name}</td>
					<td>{$vo.o_sho_phone}</td>
					<td>{$vo.o_kd_money}元</td>
					<td>{$vo.o_kddh_sncode}</td>
					<td>{if $vo.o_status==1}等待出单{else}快递已发出{/if}</td>
					<td>{$vo.o_content}</td>
					<td>
							<div class="layui-btn-group">
							{$vo.o_status}
							{if $vo.o_status == 1}
								{if $vo.w_fahuo == 2}
								<button class="layui-btn layui-btn-sm" onClick="fadan_order('{:url('order/fadan',array('id'=>$vo.o_id))}','tr_{$vo.o_id}')"><i class="layui-icon">补单</i></button>
								{/if}
							{/if}
                            {if $ps['del']['power']}
								<button class="layui-btn layui-btn-sm" onClick="calldel('{:url('order/del',array('id'=>$vo.o_id))}','tr_{$vo.o_id}')"><i class="layui-icon">&#xe640;</i></button>
                            {/if}
                            {if $ps['edit']['power']}
								{if $vo.o_status==1}
								<button class="layui-btn layui-btn-sm" onClick="callurl('{:url('order/edit',array('id'=>$vo.o_id))}')"><i class="layui-icon">&#xe642;</i></button>
								{/if}
							{/if}
							</div>
					</td>
				</tr>
			{/volist}
            </tbody>
          </table> 
		  <div class="layui-box layui-laypage layui-laypage-molv">{$page}</div>
		   
          </div>
        </div>
      </div>
    </div>
  </div>
  {include file="common_footer" /} 
  <script>
  function fadan_order(url,id){
        $.ajax({
			type:"get",
			url:url,
			dataType:"json",
			data:{},
			success:function(res){
				if(res.status == "success"){
					layer.msg(res.data, {offset: '15px',icon: 1,time: 1000}, function(){location.href = '{:url('order/index')}';});
				}else{
					layer.msg(res.data, {offset: '15px',icon: 2});
				}
			},
			error:function(jqXHR){
				console.log("Error: "+jqXHR.status);
			},
        });
}
  </script>
</body>
</html>